package com.wl2o2o.lanqiao.xzfourteen;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.util.Collection;
/** 
* @author : WLei224
* @date ：2023年4月8日 上午12:26:41 
* 
*/
import java.util.HashMap;
import java.util.HashSet;
import java.util.Set;
import java.util.Map;

public class AAAHashMapAndSet去重 {
    public static void main(String[] args) throws IOException {
    	BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    	PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));
        Map<String, Integer> map = new HashMap<>();
        // 循环添加键值对
        int n = Integer.parseInt(in.readLine());
        for (int i = 1; i <= n; i++) {
        	String[] maps = in.readLine().split(" ");
            map.put(maps[0], Integer.parseInt(maps[1]));
        }
        
        Collection<Integer> values = map.values();
        Set<Integer> set = new HashSet<Integer>(values);
        // 输出Map中的键值对
        for (Map.Entry<String, Integer> entry : map.entrySet()) {
            System.out.println("key: " + entry.getKey() + ", value: " + entry.getValue());
        }
    }
}

